package com.link.base.base.home.controller;

import com.link.base.base.home.service.HomeService;
import com.link.core.cllog.LCLogger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * @author: unknown
 * created: unknown
 * comments:
 */
@Controller
@RequestMapping("/link/dzrprodhome")
public class DzrProdHomeController {

    @Resource
    private HomeService homeService;

    @RequestMapping(value = "/mainjsp")
    @ResponseBody
    public ModelAndView main(HttpSession session, HttpServletRequest request, HttpServletResponse response) {
        ModelAndView mav = new ModelAndView();
        try {
            mav.setViewName("main/dzr/homeProd");
            mav.addObject("clueCount", homeService.queryCLueCurentWeekCount());
            mav.addObject("accountCount", homeService.queryAccountCurentWeekCount());
            mav.addObject("orderCount", homeService.queryOrderCurentWeekCount());
            mav.addObject("activityCount", homeService.queryActivityCurentWeekCount());
            mav.addObject("workplanCount", homeService.queryWorkPlanCurentWeekCount());
        } catch (Exception e) {
            LCLogger.withException(e);
        }
        return mav;
    }

}
